<?php

namespace App\Http\Controllers\Web;

use App\Http\Controllers\Controller;
use App\Models\Channels;
use App\Models\GameChannel;
use App\Models\GameLoginConfig;
use App\Models\Games;
use App\Services\GameLoginService;
use Illuminate\Http\Request;

class JuheH5GameController extends Controller
{
    public function index(Request $request, $game_original_id)
    {
        $game_id = $request->input('game_id') ?? $game_original_id;
        $game              = Games::where('game_id', $game_id)->first();
        $game_login_config = GameLoginService::getInstance()->get($game_id);

        return view('juheh5.game.index', [
            'game'              => $game,
            'game_login_config' => $game_login_config,
            'params'            => $request->all(),
        ]);
    }
}
